var express = require('express');
var router = express.Router();

/* GET home page. */
router.get('/', function (req, res, next) {
  res.render('index', {
    title: 'Express'
  });
});
// 首页推荐的数据
router.get('/api/index_list/0/data/1', function (req, res, next) {
  res.send({
    code: 0,
    data: {
      topBar: [{
          id: 0,
          label: '推荐'
        },
        {
          id: 1,
          label: '大红袍'
        },
        {
          id: 2,
          label: '铁观音'
        },
        {
          id: 3,
          label: '绿茶'
        },
        {
          id: 4,
          label: '普洱'
        },
        {
          id: 5,
          label: '茶具'
        },
        {
          id: 6,
          label: '花茶'
        },
      ],
      data: [
        // Swiper数据
        {
          id: 0,
          type: 'swiperList',
          data: [{
              id: 1,
              imgUrl: './images/swiper1.jpeg'
            },
            {
              id: 2,
              imgUrl: './images/swiper2.jpeg'
            },
            {
              id: 3,
              imgUrl: './images/swiper3.jpeg'
            }
          ]
        },
        // icons数据
        {
          id: 1,
          type: 'iconsList',
          data: [{
              id: 1,
              title: '自饮茶',
              imgUrl: './images/icons1.png'
            },
            {
              id: 2,
              title: '茶具',
              imgUrl: './images/icons2.png'
            },
            {
              id: 3,
              title: '茶礼盒',
              imgUrl: './images/icons3.png'
            },
            {
              id: 4,
              title: '领福利',
              imgUrl: './images/icons4.png'
            },
            {
              id: 5,
              title: '官方验证',
              imgUrl: './images/icons5.png'
            },
          ]
        },
        // 爆款推荐
        {
          id: 2,
          type: 'recommendList',
          data: [{
            id: 1,
            name: "龙井1號铁罐250g",
            content: "鲜爽甘醇 口粮首选",
            price: "68",
            imgUrl: "./images/recommend.jpeg",
          }, {
            id: 2,
            name: "龙井1號铁罐250g",
            content: "鲜爽甘醇 口粮首选",
            price: "68",
            imgUrl: "./images/recommend.jpeg",
          }, ]
        },
        // 猜你喜欢
        {
          id: 4,
          type: 'likeList',
          data: [{
              id: 1,
              imgUrl: "./images/like.jpeg",
              names: "居家旅行具备的 居家旅行具备的 是衣蛾安抚阿发阿发阿发阿发居家旅行具备的 是衣蛾安抚阿发阿发阿发阿发",
              price: 299,
            },
            {
              id: 2,
              imgUrl: "./images/like.jpeg",
              names: "居家旅行具备的 居家旅行具备的",
              price: 299,
            },
            {
              id: 3,
              imgUrl: "./images/like.jpeg",
              names: "居家旅行具备的 居家旅行具备的",
              price: 299,
            },
            {
              id: 4,
              imgUrl: "./images/like.jpeg",
              names: "居家旅行具备的 居家旅行具备的",
              price: 299,
            },
          ]
        },
      ]
    }
  })
});
//大红袍的数据
router.get('/api/index_list/1/data/1', function (req, res, next) {
  res.send({
    code:0,
    data: [
      // 大红袍数据
      {
        id: 1,
        type: 'adList',
        data: [{
            id: 1,
            imgUrl: './images/dhp.jpeg'
          },
          {
            id: 2,
            imgUrl: './images/dhp.jpeg'
          },
        ]
      },
      //猜你喜欢
      {
        id: 2,
        type: 'likeList',
        data: [{
            id: 1,
            imgUrl: "./images/like.jpeg",
            names: "居家旅行具备的 居家旅行具备的 是衣蛾安抚阿发阿发阿发阿发居家旅行具备的 是衣蛾安抚阿发阿发阿发阿发",
            price: 299,
          },
          {
            id: 2,
            imgUrl: "./images/like.jpeg",
            names: "居家旅行具备的 居家旅行具备的",
            price: 299,
          },
          {
            id: 3,
            imgUrl: "./images/like.jpeg",
            names: "居家旅行具备的 居家旅行具备的",
            price: 299,
          },
          {
            id: 4,
            imgUrl: "./images/like.jpeg",
            names: "居家旅行具备的 居家旅行具备的",
            price: 299,
          },
        ]
      },
    ]
  })
});
//铁观音的数据
router.get('/api/index_list/2/data/1', function (req, res, next) {
  res.send({
    code: 0,
    data: [
      // 铁观音的数据
      {
        id: 1,
        type: 'adList',
        data: [{
            id: 1,
            imgUrl: './images/tgy.jpeg'
          },
          {
            id: 2,
            imgUrl: './images/tgy.jpeg'
          },
        ]
      },
      //猜你喜欢
      {
        id: 2,
        type: 'likeList',
        data: [{
            id: 1,
            imgUrl: "./images/like.jpeg",
            names: "居家旅行具备的 居家旅行具备的 是衣蛾安抚阿发阿发阿发阿发居家旅行具备的 是衣蛾安抚阿发阿发阿发阿发",
            price: 299,
          },
          {
            id: 2,
            imgUrl: "./images/like.jpeg",
            names: "居家旅行具备的 居家旅行具备的",
            price: 299,
          },
          {
            id: 3,
            imgUrl: "./images/like.jpeg",
            names: "居家旅行具备的 居家旅行具备的",
            price: 299,
          },
          {
            id: 4,
            imgUrl: "./images/like.jpeg",
            names: "居家旅行具备的 居家旅行具备的",
            price: 299,
          },
        ]
      },
    ]
  })
});
module.exports = router;